<template>
  <div class="home">
    <my-child
      :msgs="msg"
      @handler="clickHandler"
      @click.native="handlerNative"
    ></my-child>
    <helloworld></helloworld>

    <component :is="com"></component>
  </div>
</template>

<script>
import myChild from "@/components/myChild.vue";
import helloworld from "../components/HelloWorld.vue";
export default {
  name: "home",
  data() {
    return {
      msg: "hello world",
      com: "myChild",
    };
  },
  components: {
    myChild,
    helloworld,
  },
  methods: {
    clickHandler(val) {
      console.log(val);
    },
    handlerNative() {
      console.log("子组件绑定了一个点击事件");
    },
  },
};
</script>
